import { defineStore } from "pinia";
import { getOrderList } from "../../services/modules/orderRequest";

export default defineStore("order", {
    // 数据
    state: () => ({
        orderList: {},
    }),
    // 操作
    actions: {
        // type=pend 未完成订单
        // type=recent 最近订单
        // type=all 全部订单
        fetchOrderList(type) {
            getOrderList(type).then(res => {
                this.orderList = res.data.data.orders
            })
        }
    }
})